@extends('admin.master')
        
@section('content')
            <h1>Páginas</h1>
            
            {{-- will be used to show any messages --}}
            @if (Session::has('message'))
            <div class="alert alert-info">{{ Session::get('message') }}</div>
            @endif
            
            <div class="table-responsive">
            <table id="sort" class="table table-hover table-bordered table-condensed">
                <thead>
                    <tr>
                        <th>Titulo</th>
                        <th>Texto</th>
                        <th class="text-center">Estado</th>
                        <th class="text-center">Editar</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($pages as $key => $value)
                    <tr id="items_{{ $value->id }}">
                        <td>{{{ $value->titulo }}}</td>
                        <td>
                            {{ Str::limit( strip_tags ($value->texto), $limit = 50, $end = '...')  }}
                        </td>
                        <td class="text-center">
                            @if($value->estado)
                                <span class="glyphicon glyphicon-ok"></span>
                            @else
                                <span class="glyphicon glyphicon-minus"></span>
                            @endif
                        </td>
                        <td class="text-center">
                            <!-- edit this objeto (uses the edit method found at GET /objetos/{id}/edit -->
                            <a class="btn btn-xs btn-info" href="{{ URL::to('admin/pages/' . $value->id . '/edit') }}"><span class="glyphicon glyphicon-pencil"></span></a>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
@stop

@section('js-footer')
@parent
{{ HTML::script('assets/admin/js/scripts.js') }}
<script type="text/javascript">
    // $( ordenarItems("#sort tbody", "{{ URL::route('adminOrderObjetos') }}", 'y') );
</script>
@stop

